package com.foreverwin.mes.meapi.service.impl;

import com.foreverwin.mes.core.base.FrontPage;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.foreverwin.mes.meapi.model.Vendor;
import com.foreverwin.mes.meapi.mapper.VendorMapper;
import com.foreverwin.mes.meapi.service.VendorService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Ervin Chen
 * @since 2020-03-23
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class VendorServiceImpl extends ServiceImpl<VendorMapper, Vendor> implements VendorService {


    @Autowired
    private VendorMapper vendorMapper;

    @Override
    public Page<Vendor> selectPage(FrontPage<Vendor> frontPage, Vendor vendor) {
        EntityWrapper<Vendor> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(vendor);
        return super.selectPage(frontPage.getPagePlus(), queryWrapper);
    }

    @Override
    public List<Vendor> selectList(Vendor vendor) {
        EntityWrapper<Vendor> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(vendor);
        return super.selectList(queryWrapper);
    }


}